#  author:张靖昆 date:2020/3/5 name:5_字典 IDE:PyCharm
# 字典    可以储存任意对象 可变类型
boyf={'name':'王一博','age':'22','颜值':'100'}
# 字典每个键值对应（key_value）
# 字典循环
# 1.通过key（）
# 输出key
# for key in boyf:
#     print(key)
#
# for key in boyf.keys():
#     print(key)
# 输出 value
# for v in boyf.values():
#     print(v)
#
# 通过items（）  输出key_value
# for i in boyf.items():
#     print(i)  # 元组
# for i in boyf:
    # print(i+':'+boyf[i])
    # print(i+':'+str(boyf.get(i)))
# print(boyf.get('name'))
# print(boyf['sex']  # 输出没有的则报错
boyf['name']='aabb'
print(boyf)